<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <link rel="apple-touch-icon" sizes="76x76" href="/img/apple-icon.png">
    <link rel="icon" type="image/png" href="/img/favicon.png">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <title>
        AntRpc Console
    </title>
    <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no'
          name='viewport'/>
    <!--     Fonts and icons     -->
    <link href="/css/google-fonts.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/css/fontawesome-v5.7.1-all.css">
    <!-- CSS Files -->
    <link href="/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="/css/now-ui-dashboard.min.css" rel="stylesheet"/>
    <link href="/css/my.css" rel="stylesheet"/>
    <!-- CSS Just for demo purpose, don't include it in your project -->

</head>
<body>
<div class="wrapper ">
    <div th:replace="~{common :: #common-sidebar}"></div>
    <div class="main-panel" id="main-panel">
        <nav id="common-nav" class="navbar navbar-expand-lg navbar-transparent  bg-primary  navbar-absolute">
            <div class="container-fluid my-padding-left-top-0">
                <div th:replace="~{common :: #commons-nav-btns}"></div>
                <div class="collapse navbar-collapse justify-content-end w-100" id="navigation">
                    <form style="width: 100%;" action="/">
                        <div class="input-group no-border">
                            <input type="text" name="name" class="form-control" placeholder="Search..."/>
                            <div class="input-group-append">
                                <div class="input-group-text">
                                    <i class="now-ui-icons ui-1_zoom-bold"></i>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </nav>
        <div class="panel-header panel-header-sm"></div>
        <div class="content">
            <div class="row">
                <div class="col-md-12">
                    <div class="card">
                        <div class="card-header">
                            <h5 class="card-title">接口列表</h5>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive">
                                <table class="table">
                                    <thead class="text-primary">
                                    <tr>
                                        <th>#</th>
                                        <th>接口名</th>
                                        <th></th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr th:each="it, itStat : ${interfaces}">
                                        <td th:text="${itStat.index + 1}"></td>
                                        <td th:text="${it}"></td>
                                        <td>
                                            <button type="button" rel="tooltip" title="方法列表"
                                                    class="btn btn-info btn-icon btn-sm "
                                                    th:attr="data-className=${it}"
                                                    onclick="goto_methods(this)">
                                                <i class="now-ui-icons design_bullet-list-67"></i>
                                            </button>
                                            <button type="button" rel="tooltip" title="详情"
                                                    th:attr="data-className=${it}"
                                                    onclick="goto_details(this)"
                                                    class="btn btn-info btn-icon btn-sm ">
                                                <i class="now-ui-icons ui-2_settings-90"></i>
                                            </button>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div th:insert="js"></div>
<script>
    $(document).ready(function () {
        $("#service_list_li").addClass("active");
    });

    function goto_methods(btn) {
        window.location.href = "/methods?className=" + $(btn).attr("data-className");
    }

    function goto_details(btn) {
        window.location.href = "/details?clazz=" + $(btn).attr("data-className");
    }
</script>
</body>
</html>